import React, {useEffect, useState} from "react";
import {flowXmlAndNode, processVariables} from "@/api/flowable/taskFinish";
import ProcessView from "@/components/prcessView"

interface MyComponentProps {
    processDetail: {
        deployId?: number;
        procInsId?: number;
    };
}

const flowXmlAndNodeView: React.FC<MyComponentProps> = (props) => {
    const {processDetail} = props;
    const [formObject, setFormObject] = useState<string>('');
    useEffect(() => {

        console.log(processDetail, "33");
        getList()
    }, []);

    const getList = () => {
        flowXmlAndNode(processDetail.procInsId, processDetail.deployId).then((res:any) => {
            if (res.code == 200) {
                setFormObject(JSON.stringify(res.data));
                console.log("33", formObject);
            }

        });

    }
    return (
        <div>
            {formObject && <ProcessView formObject={formObject}></ProcessView>}
        </div>
    )
}
export default flowXmlAndNodeView
